﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Speech.Synthesis;

namespace MBO_PIM
{
    public class Sprachausgabe
    {
        private System.Speech.Synthesis.SpeechSynthesizer synthesizer;

        public Sprachausgabe()
        {
            synthesizer = new System.Speech.Synthesis.SpeechSynthesizer();
        }

        public void SayString(Object str){

            try
            {
            synthesizer.SpeakAsyncCancelAll();
            String output = (String)str;
            this.synthesizer.Speak(output);
           }
            catch { }
        }

        public void SayBuilder(Object builderinput)
        {
            try
            {
                synthesizer.SpeakAsyncCancelAll();
                PromptBuilder builder = (PromptBuilder)builderinput;
                this.synthesizer.Speak(builder);
            }
            catch { }
        }

        public void SayStringTest()
        {
            synthesizer.SpeakAsyncCancelAll();
            this.synthesizer.Speak("Test");
        }
    }
}
